<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>easynode.framework.server.tcp.TCPServer - EasyNode API参考文档</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="EasyNode API参考文档" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: EasyNode - 0.1.0</em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/EasyNode.html">EasyNode</a></li>
                                <li><a href="../classes/easynode.framework.aop.AOP.html">easynode.framework.aop.AOP</a></li>
                                <li><a href="../classes/easynode.framework.BeanFactory.html">easynode.framework.BeanFactory</a></li>
                                <li><a href="../classes/easynode.framework.cache.CacheStat.html">easynode.framework.cache.CacheStat</a></li>
                                <li><a href="../classes/easynode.framework.cache.ICache.html">easynode.framework.cache.ICache</a></li>
                                <li><a href="../classes/easynode.framework.cache.Memcached.html">easynode.framework.cache.Memcached</a></li>
                                <li><a href="../classes/easynode.framework.cache.Redis.html">easynode.framework.cache.Redis</a></li>
                                <li><a href="../classes/easynode.framework.db.IConnection.html">easynode.framework.db.IConnection</a></li>
                                <li><a href="../classes/easynode.framework.db.IDataSource.html">easynode.framework.db.IDataSource</a></li>
                                <li><a href="../classes/easynode.framework.db.MysqlConnection.html">easynode.framework.db.MysqlConnection</a></li>
                                <li><a href="../classes/easynode.framework.db.MysqlDataSource.html">easynode.framework.db.MysqlDataSource</a></li>
                                <li><a href="../classes/easynode.framework.Logger.html">easynode.framework.Logger</a></li>
                                <li><a href="../classes/easynode.framework.mq.IQueue.html">easynode.framework.mq.IQueue</a></li>
                                <li><a href="../classes/easynode.framework.mq.RedisListQueue.html">easynode.framework.mq.RedisListQueue</a></li>
                                <li><a href="../classes/easynode.framework.mq.RedisQueue.html">easynode.framework.mq.RedisQueue</a></li>
                                <li><a href="../classes/easynode.framework.mvc.Action.html">easynode.framework.mvc.Action</a></li>
                                <li><a href="../classes/easynode.framework.mvc.ActionArgConverter.html">easynode.framework.mvc.ActionArgConverter</a></li>
                                <li><a href="../classes/easynode.framework.mvc.ActionContext.html">easynode.framework.mvc.ActionContext</a></li>
                                <li><a href="../classes/easynode.framework.mvc.ActionExecutor.html">easynode.framework.mvc.ActionExecutor</a></li>
                                <li><a href="../classes/easynode.framework.mvc.ActionFactory.html">easynode.framework.mvc.ActionFactory</a></li>
                                <li><a href="../classes/easynode.framework.mvc.ActionRequestParameter.html">easynode.framework.mvc.ActionRequestParameter</a></li>
                                <li><a href="../classes/easynode.framework.mvc.ActionResult.html">easynode.framework.mvc.ActionResult</a></li>
                                <li><a href="../classes/easynode.framework.mvc.CombinedAction.html">easynode.framework.mvc.CombinedAction</a></li>
                                <li><a href="../classes/easynode.framework.mvc.EJSTemplateViewRenderer.html">easynode.framework.mvc.EJSTemplateViewRenderer</a></li>
                                <li><a href="../classes/easynode.framework.mvc.IActionContextListener.html">easynode.framework.mvc.IActionContextListener</a></li>
                                <li><a href="../classes/easynode.framework.mvc.ITemplateViewRenderer.html">easynode.framework.mvc.ITemplateViewRenderer</a></li>
                                <li><a href="../classes/easynode.framework.mvc.JadeTemplateViewRenderer.html">easynode.framework.mvc.JadeTemplateViewRenderer</a></li>
                                <li><a href="../classes/easynode.framework.mvc.JSONView.html">easynode.framework.mvc.JSONView</a></li>
                                <li><a href="../classes/easynode.framework.mvc.MethodDispatchedAction.html">easynode.framework.mvc.MethodDispatchedAction</a></li>
                                <li><a href="../classes/easynode.framework.mvc.Model.html">easynode.framework.mvc.Model</a></li>
                                <li><a href="../classes/easynode.framework.mvc.ModelField.html">easynode.framework.mvc.ModelField</a></li>
                                <li><a href="../classes/easynode.framework.mvc.ModelProxyActionFactory.html">easynode.framework.mvc.ModelProxyActionFactory</a></li>
                                <li><a href="../classes/easynode.framework.mvc.MustacheTemplateViewRenderer.html">easynode.framework.mvc.MustacheTemplateViewRenderer</a></li>
                                <li><a href="../classes/easynode.framework.mvc.spi.MysqlModelGenerator.html">easynode.framework.mvc.spi.MysqlModelGenerator</a></li>
                                <li><a href="../classes/easynode.framework.mvc.View.html">easynode.framework.mvc.View</a></li>
                                <li><a href="../classes/easynode.framework.plugin.EasyNodePlugin.html">easynode.framework.plugin.EasyNodePlugin</a></li>
                                <li><a href="../classes/easynode.framework.plugin.PluginLoadContext.html">easynode.framework.plugin.PluginLoadContext</a></li>
                                <li><a href="../classes/easynode.framework.queue.MQTTQueue.html">easynode.framework.queue.MQTTQueue</a></li>
                                <li><a href="../classes/easynode.framework.server.AbstractServer.html">easynode.framework.server.AbstractServer</a></li>
                                <li><a href="../classes/easynode.framework.server.http.KOAActionContext.html">easynode.framework.server.http.KOAActionContext</a></li>
                                <li><a href="../classes/easynode.framework.server.http.KOADefaultRoutes.html">easynode.framework.server.http.KOADefaultRoutes</a></li>
                                <li><a href="../classes/easynode.framework.server.http.KOAHttpRequestParameter.html">easynode.framework.server.http.KOAHttpRequestParameter</a></li>
                                <li><a href="../classes/easynode.framework.server.http.KOAHttpServer.html">easynode.framework.server.http.KOAHttpServer</a></li>
                                <li><a href="../classes/easynode.framework.server.http.KOAHttpServer.SessionSupport.html">easynode.framework.server.http.KOAHttpServer.SessionSupport</a></li>
                                <li><a href="../classes/easynode.framework.server.KOAMemorySessionStorage.html">easynode.framework.server.KOAMemorySessionStorage</a></li>
                                <li><a href="../classes/easynode.framework.server.ServerStat.html">easynode.framework.server.ServerStat</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.Decoder.html">easynode.framework.server.tcp.Decoder</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.Encoder.html">easynode.framework.server.tcp.Encoder</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.Message.html">easynode.framework.server.tcp.Message</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.MessageHandler.html">easynode.framework.server.tcp.MessageHandler</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.protocols.JSONDecoder.html">easynode.framework.server.tcp.protocols.JSONDecoder</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.protocols.JSONEncoder.html">easynode.framework.server.tcp.protocols.JSONEncoder</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.protocols.JSONMessageHandler.html">easynode.framework.server.tcp.protocols.JSONMessageHandler</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.StreamDecoderHelper.html">easynode.framework.server.tcp.StreamDecoderHelper</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.StreamEncoderHelper.html">easynode.framework.server.tcp.StreamEncoderHelper</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.TCPClient.html">easynode.framework.server.tcp.TCPClient</a></li>
                                <li><a href="../classes/easynode.framework.server.tcp.TCPServer.html">easynode.framework.server.tcp.TCPServer</a></li>
                                <li><a href="../classes/easynode.framework.test.TestCase.html">easynode.framework.test.TestCase</a></li>
                                <li><a href="../classes/easynode.framework.test.TestCaseRunner.html">easynode.framework.test.TestCaseRunner</a></li>
                                <li><a href="../classes/easynode.framework.util..StringUtil.html">easynode.framework.util..StringUtil</a></li>
                                <li><a href="../classes/easynode.framework.util.Binary.html">easynode.framework.util.Binary</a></li>
                                <li><a href="../classes/easynode.framework.util.HTTPUtil.html">easynode.framework.util.HTTPUtil</a></li>
                                <li><a href="../classes/easynode.framework.util.MustacheHelper.html">easynode.framework.util.MustacheHelper</a></li>
                                <li><a href="../classes/easynode.framework.util.ObjectWrapper.html">easynode.framework.util.ObjectWrapper</a></li>
                                <li><a href="../classes/easynode.framework.util.SqlUtil.html">easynode.framework.util.SqlUtil</a></li>
                                <li><a href="../classes/easynode.framework.util.VersionComparator.html">easynode.framework.util.VersionComparator</a></li>
                                <li><a href="../classes/easynode.framework.view.TemplateView.html">easynode.framework.view.TemplateView</a></li>
                                <li><a href="../classes/easynode.GenericObject.html">easynode.GenericObject</a></li>
                                <li><a href="../classes/全局函数.html">全局函数</a></li>
                            </ul>
                
                            <ul id="api-modules" class="apis modules">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>easynode.framework.server.tcp.TCPServer Class</h1>
<div class="box meta">

        <div class="extends">
            Extends <a href="../classes/easynode.GenericObject.html" class="crosslink">easynode.GenericObject</a>
        </div>

        <div class="foundat">
            Defined in: <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l14"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:14</code></a>
        </div>


        <p>Available since 0.1.0</p>
</div>


<div class="box intro">
    <p>Class TCPServer</p>

</div>


<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
            <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods extends">
                            <li class="index-item method private">
                                <a href="#method__encapsulateSocket">_encapsulateSocket</a>

                            </li>
                            <li class="index-item method private">
                                <a href="#method__onClientConnect">_onClientConnect</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_disconnect">disconnect</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_getClassName">getClassName</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getClientByAlias">getClientByAlias</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getClientsCount">getClientsCount</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_is">is</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_noop">noop</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_off">off</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_setClientAlias">setClientAlias</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_setClientFactory">setClientFactory</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_setDecoder">setDecoder</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_setEncoder">setEncoder</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_setEncoder">setEncoder</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_toJSON">toJSON</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_toJSONString">toJSONString</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_toString">toString</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_trigger">trigger</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_构造函数">构造函数</a>

                            </li>
                    </ul>
                </div>

                <div class="index-section properties">
                    <h3>Properties</h3>

                    <ul class="index-list properties extends">
                            <li class="index-item property private">
                                <a href="#property__clientAlias">_clientAlias</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property__clientFactory">_clientFactory</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property__clients">_clients</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property__clientsCount">_clientsCount</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property__decoder">_decoder</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property__encoder">_encoder</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property__isRunning">_isRunning</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property__messageHandler">_messageHandler</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property__server">_server</a>

                            </li>
                    </ul>
                </div>


        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method__encapsulateSocket" class="method item private">
    <h3 class="name"><code>_encapsulateSocket</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>socket</code>
                </li>
            </ul><span class="paren">)</span>
        </div>



        <span class="flag private">private</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l200"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:200</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>包装Socket。</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">socket</code>
                        <span class="type">Socket</span>


                    <div class="param-description">
                        <p>Socket实例</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method__onClientConnect" class="method item private">
    <h3 class="name"><code>_onClientConnect</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>socket</code>
                </li>
            </ul><span class="paren">)</span>
        </div>



        <span class="flag private">private</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l227"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:227</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>网络连接事件处理函数。</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">socket</code>
                        <span class="type">Socket</span>


                    <div class="param-description">
                        <p>Socket实例</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_disconnect" class="method item">
    <h3 class="name"><code>disconnect</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>socketId</code>
                </li>
                <li class="arg">
                        <code>reason</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l323"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:323</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>断开连接。</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">socketId</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        <p>client.getId()或client.getSocketId()或socket.SOCKET_ID</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">reason</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        <p>断开原因</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_getClassName" class="method item inherited">
    <h3 class="name"><code>getClassName</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/easynode.GenericObject.html#method_getClassName">easynode.GenericObject</a>:
        <a href="../files/.._src_easynode_GenericObject.js.html#l82"><code>..&#x2F;src&#x2F;easynode&#x2F;GenericObject.js:82</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        获取对象的全类名
    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>:
                    对象的字符串描述
            </div>
        </div>


</div>
<div id="method_getClientByAlias" class="method item">
    <h3 class="name"><code>getClientByAlias</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>alias</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="../classes/easynode.framework.server.tcp.TCPClient.html" class="crosslink">easynode.framework.server.tcp.TCPClient</a></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l298"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:298</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>根据客户端别名查找客户端实例</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">alias</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        <p>客户端别名</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="../classes/easynode.framework.server.tcp.TCPClient.html" class="crosslink">easynode.framework.server.tcp.TCPClient</a></span>:
                    <p>客户端实例，具体类型取决于ClientFactory</p>

            </div>
        </div>


</div>
<div id="method_getClientsCount" class="method item">
    <h3 class="name"><code>getClientsCount</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type">Int</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l311"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:311</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>获取当前的客户端连接总数。</p>

    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Int</span>:
                    <p>客户端总数</p>

            </div>
        </div>


</div>
<div id="method_is" class="method item inherited">
    <h3 class="name"><code>is</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>namespace</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/easynode.GenericObject.html#method_is">easynode.GenericObject</a>:
        <a href="../files/.._src_easynode_GenericObject.js.html#l133"><code>..&#x2F;src&#x2F;easynode&#x2F;GenericObject.js:133</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        判定对象是否属于某个类型
    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">namespace</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        全类名
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
                    对象是否为某个类的实例
            </div>
        </div>


        <div class="example">
            <h4>Example:</h4>

            <div class="example-content">
                <p>var ExpressServer = using('easynode.framework.server.http.ExpressServer');
new ExpressServer(3010).is('easynode.framework.server.http.ExpressServer');  <a href="//true">//true</a></p>

            </div>
        </div>
</div>
<div id="method_noop" class="method item inherited">
    <h3 class="name"><code>noop</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type"></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/easynode.GenericObject.html#method_noop">easynode.GenericObject</a>:
        <a href="../files/.._src_easynode_GenericObject.js.html#l149"><code>..&#x2F;src&#x2F;easynode&#x2F;GenericObject.js:149</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        无操作函数。可链式调用。
    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                    this
            </div>
        </div>


        <div class="example">
            <h4>Example:</h4>

            <div class="example-content">
                <p>var ExpressServer = using('easynode.framework.server.http.ExpressServer');
new ExpressServer(3010).is('easynode.framework.server.http.ExpressServer');  <a href="//true">//true</a></p>

            </div>
        </div>
</div>
<div id="method_off" class="method item inherited">
    <h3 class="name"><code>off</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>event</code>
                </li>
                <li class="arg">
                        <code>listener</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>Inherited from
                <a href="../classes/easynode.GenericObject.html#method_off">easynode.GenericObject</a>:
        <a href="../files/.._src_easynode_GenericObject.js.html#l56"><code>..&#x2F;src&#x2F;easynode&#x2F;GenericObject.js:56</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        removeListener函数的别名。参考：Node.js events.EventEmitter.removeListener()函数。
    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">event</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        事件名称
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">listener</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a></span>


                    <div class="param-description">
                        事件监听器
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_setClientAlias" class="method item">
    <h3 class="name"><code>setClientAlias</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>alias</code>
                </li>
                <li class="arg">
                        <code>client</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l280"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:280</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>设置客户端别名。</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">alias</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        <p>客户端别名</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">client</code>
                        <span class="type"><a href="../classes/easynode.framework.server.tcp.TCPClient.html" class="crosslink">easynode.framework.server.tcp.TCPClient</a></span>


                    <div class="param-description">
                        <p>客户端实例，具体类型取决于ClientFactory</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_setClientFactory" class="method item">
    <h3 class="name"><code>setClientFactory</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>namespace</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l180"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:180</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>设置client实例工厂。</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">namespace</code>
                        <span class="type">String/class</span>


                    <div class="param-description">
                        <p>客户端工厂全类名或客户端工厂类。该类要求继承于easynode.framework.server.tcp.TCPServer</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_setDecoder" class="method item">
    <h3 class="name"><code>setDecoder</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>decoder</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l135"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:135</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>设置decoder。</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">decoder</code>
                        <span class="type">easynode.framework.server.tcp.ITCPDecoder</span>


                    <div class="param-description">
                        <p>解码器</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                    <p>this　可链式调用</p>

            </div>
        </div>


</div>
<div id="method_setEncoder" class="method item">
    <h3 class="name"><code>setEncoder</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>encoder</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l150"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:150</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>设置encoder。</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">encoder</code>
                        <span class="type">easynode.framework.server.tcp.ITCPEncoder</span>


                    <div class="param-description">
                        <p>编码器</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                    <p>this　可链式调用</p>

            </div>
        </div>


</div>
<div id="method_setEncoder" class="method item">
    <h3 class="name"><code>setEncoder</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>messageHandler</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l165"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:165</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>设置消息处理器。</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">messageHandler</code>
                        <span class="type">easynode.framework.server.tcp.IMessageHandler</span>


                    <div class="param-description">
                        <p>消息处理器</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                    <p>this　可链式调用</p>

            </div>
        </div>


</div>
<div id="method_toJSON" class="method item inherited">
    <h3 class="name"><code>toJSON</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/easynode.GenericObject.html#method_toJSON">easynode.GenericObject</a>:
        <a href="../files/.._src_easynode_GenericObject.js.html#l105"><code>..&#x2F;src&#x2F;easynode&#x2F;GenericObject.js:105</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        返回对象的JSON对象，即：Notation
    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>:
                    <p>对象的Notation</p>

            </div>
        </div>


</div>
<div id="method_toJSONString" class="method item inherited">
    <h3 class="name"><code>toJSONString</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/easynode.GenericObject.html#method_toJSONString">easynode.GenericObject</a>:
        <a href="../files/.._src_easynode_GenericObject.js.html#l93"><code>..&#x2F;src&#x2F;easynode&#x2F;GenericObject.js:93</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        返回对象的JSON String表达式
    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>:
                    对象的JSON字符串描述
            </div>
        </div>


</div>
<div id="method_toString" class="method item inherited">
    <h3 class="name"><code>toString</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/easynode.GenericObject.html#method_toString">easynode.GenericObject</a>:
        <a href="../files/.._src_easynode_GenericObject.js.html#l70"><code>..&#x2F;src&#x2F;easynode&#x2F;GenericObject.js:70</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        获取对象的字符串描述
    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>:
                    对象的字符串描述
            </div>
        </div>


</div>
<div id="method_trigger" class="method item inherited">
    <h3 class="name"><code>trigger</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>event</code>
                </li>
                <li class="arg">
                        <code>args</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>Inherited from
                <a href="../classes/easynode.GenericObject.html#method_trigger">easynode.GenericObject</a>:
        <a href="../files/.._src_easynode_GenericObject.js.html#l43"><code>..&#x2F;src&#x2F;easynode&#x2F;GenericObject.js:43</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        emit函数的别名。参考：Node.js events.EventEmitter.emit()函数。
    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">event</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        事件名称
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">args</code>
                        <span class="type">...</span>


                    <div class="param-description">
                        事件参数
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_构造函数" class="method item">
    <h3 class="name"><code>构造函数</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>decoder</code>
                </li>
                <li class="arg">
                        <code>encoder</code>
                </li>
                <li class="arg">
                        <code>messageHandler</code>
                </li>
                <li class="arg">
                        <code>port</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
            <p>Inherited from
            <a href="../classes/easynode.GenericObject.html#method_构造函数">
                easynode.GenericObject
            </a>
            but overwritten in
        <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l23"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:23</code></a>
        </p>



            <p>Available since 0.1.0</p>
    </div>

    <div class="description">
        <p>构造函数。</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">decoder</code>
                        <span class="type">easynode.framework.server.tcp.ITCPDecoder</span>


                    <div class="param-description">
                        <p>解码器, Optional</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">encoder</code>
                        <span class="type">easynode.framework.server.tcp.ITCPEncoder</span>


                    <div class="param-description">
                        <p>编码器, Optional</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">messageHandler</code>
                        <span class="type">easynode.framework.server.tcp.IMessageHandler</span>


                    <div class="param-description">
                        <p>消息处理器, Optional</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">port</code>
                        <span class="type">Int</span>


                    <div class="param-description">
                        <p>TCP监听端口，默认6000，配置项：easynode.servers.tcpServer.port, Optional</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
            </div>

            <div id="properties" class="api-class-tabpanel">
                <h2 class="off-left">Properties</h2>

                    <div id="property__clientAlias" class="property item private">
                        <h3 class="name"><code>_clientAlias</code></h3>
                        <span class="type">Map(String -> easynode.framework.server.tcp.TCPClient)</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l53"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:53</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>客户端别名，alias -&gt; easynode.framework.server.tcp.TCPClient</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property__clientFactory" class="property item private">
                        <h3 class="name"><code>_clientFactory</code></h3>
                        <span class="type">Class</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l113"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:113</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>客户端工厂类。</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> easynode.framework.server.tcp.TCPClient</p>
                    
                    
                    </div>
                    <div id="property__clients" class="property item private">
                        <h3 class="name"><code>_clients</code></h3>
                        <span class="type">Map(String -> easynode.framework.server.tcp.TCPClient)</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l42"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:42</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>客户端连接map，session id -&gt; easynode.framework.server.tcp.TCPClient</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property__clientsCount" class="property item private">
                        <h3 class="name"><code>_clientsCount</code></h3>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l63"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:63</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>客户端连接数</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property__decoder" class="property item private">
                        <h3 class="name"><code>_decoder</code></h3>
                        <span class="type">easynode.framework.server.tcp.ITCPDecoder</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l73"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:73</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Decoder</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property__encoder" class="property item private">
                        <h3 class="name"><code>_encoder</code></h3>
                        <span class="type">easynode.framework.server.tcp.ITCPEncoder</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l83"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:83</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Encoder</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property__isRunning" class="property item private">
                        <h3 class="name"><code>_isRunning</code></h3>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l103"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:103</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>指示TCP服务是否已经启动。</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property__messageHandler" class="property item private">
                        <h3 class="name"><code>_messageHandler</code></h3>
                        <span class="type">easynode.framework.server.tcp.IMessageHandler</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l93"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:93</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>MessageHandler, 处理Decoder解码过的消息</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property__server" class="property item private">
                        <h3 class="name"><code>_server</code></h3>
                        <span class="type">net.Server</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/.._src_easynode_framework_server_tcp_TCPServer.js.html#l124"><code>..&#x2F;src&#x2F;easynode&#x2F;framework&#x2F;server&#x2F;tcp&#x2F;TCPServer.js:124</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>net.Server实例。</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> null</p>
                    
                    
                    </div>
            </div>


    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
